﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="EventRegistrationWeb._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Welcome to ASP.NET!
    </h2>
    <table class="style1">
        <tr>
            <td>
                <asp:Label ID="LabelEvent" runat="server" Text="Event:"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="DropDownListEvents" runat="server">
                    <asp:ListItem>SQL Server 2008 and XML</asp:ListItem>
                    <asp:ListItem>Office 2007 and XML</asp:ListItem>
                    <asp:ListItem>Introduction to ASP.NET</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelFirstName" runat="server" Text="FirstName:"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextFirstName" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="TextFirstName" ErrorMessage="Firstname is required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelLastname" runat="server" Text="LastName:"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextLastName" runat="server" ></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="TextLastName" ErrorMessage="Lastname is required"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelEmail" runat="server" Text="Email:"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextEmail" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="TextEmail" Display="Dynamic" 
                    ErrorMessage="Email is required"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="TextEmail" Display="Dynamic" 
                    ErrorMessage="Enter a valid email" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelResult" runat="server" Text="Result:"></asp:Label>
            </td>
            <td>
                <asp:Button ID="ButtonSubmit" runat="server" onclick="ButtonSubmit_Click" 
                    Text="Submit" PostBackUrl="~/ResultsPage.aspx" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <p>
        &nbsp;</p>
</asp:Content>
